package com.imooc.miaosha.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.imooc.miaosha.rabbitmq.MQSender;
import com.imooc.miaosha.result.Result;

@Controller
@RequestMapping("/demo")
public class SampleController {
	
	@Autowired
	MQSender sender;
	
	@RequestMapping("/mq")
	@ResponseBody
	public Result<String> mq(){
		sender.send("hello,imooc");
		return Result.success("hello,world");
	}

}
